//作业
function makeSegment(startPoint, endPoint) {
    return [startPoint, endPoint];
  }
  function startSegment(segment) {
    return segment[0];
  }
  function endSegment(segment) {
    return segment[1];
  }
  function makePoint(x, y) {
    return [x, y];
  }
  function xPoint(point) {
    return point[0];
  }
  function yPoint(point) {
    return point[1];
  }
  
  function pair(x, y) {
    return m => m(x, y);  
  }
  function head(z) {
    return z(x)
  }
  function tail(z) {
    return z(y)
  }

  console.log(head(pair(3, 4)));